<!DOCTYPE >
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>基本设置</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/system/css/right.css">
<script type="text/javascript" src="__PUBLIC__/system/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/system/js/system.js"></script>
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
<js href="__PUBLIC__/system/js/ajaxupload.js" />
</head>
<body style="overflow: auto;">
	<div class="basic bor">
			<div class="title fl">当前位置：文章管理 > 添加文章</div>
			<div class="basic_r fr"><a href="{:U('Index/setting')}">基本信息</a></div>
	</div>
	<div class="notice">
			<div class="n_title">
				<span class="fl">添加文章</span>
				
			</div>
			<div class="ncontent">
				<form action="{:U('News/newsadds')}" method="post" enctype="multipart/form-data" >
					<div class="setting">

						<ul>

							<li>
								<dd class="setting_t fl"><span>*</span>文章标题 ：</dd>
								<dd class="setting_p fl"><input class="seinp" type="text" name="title" value="{$catename.title}">
									<span>产品名称不能为空</span>
								</dd>
							</li>


							<li>
								<dd class="setting_t fl"><span>*</span>是推荐 ：</dd>
								<dd class="setting_p fl">
									<input name="fruit" 
									 type="radio" 
										<if condition="$catename['fruit'] eq 1 ">checked = "checked"</if>
								 value="1"/>

									 </label> 是

									 	<label>


										<input name="fruit" 
									 type="radio" 
										<if condition="$catename['fruit'] eq 0 ">checked = "checked"</if>
									 value="0" />




									 </label>
									  否 

								</dd>
							</li>

							<li>
								<dd class="setting_t fl"><span>*</span>是最新 ：</dd>
								<dd class="setting_p fl">
									<input name="zuixin" 
									 type="radio" 
										<if condition="$catename['zuixin'] eq 1 ">checked = "checked"</if>
								 value="1"/>

									 </label> 是

									 	<label>


										<input name="zuixin" 
									 type="radio" 
										<if condition="$catename['zuixin'] eq 0 ">checked = "checked"</if>
									 value="0" />




									 </label>
									  否 

								</dd>
							</li>		<li>
								<dd class="setting_t fl"><span>*</span>标杆楼盘推荐 ：</dd>
								<dd class="setting_p fl">
									<input name="biaogan" 
									 type="radio" 
										<if condition="$catename['biaogan'] eq 1 ">checked = "checked"</if>
								 value="1"/>

									 </label> 是

									 	<label>


										<input name="biaogan" 
									 type="radio" 
										<if condition="$catename['biaogan'] eq 0 ">checked = "checked"</if>
									 value="0" />




									 </label>
									  否 

								</dd>
							</li>

							<li>
								<dd class="setting_t fl"><span>*</span>缩略图 ：</dd>
								<dd class="setting_p fl">
									<div class="infx">
									<input class="infile" type="file" id="J_dy_img" >
									<input type="hidden" class="scan J_upload" id="is_pach" name="pic" value="{$catename.pic}"  />
									<span class="text_s">上传文件</span>
									</div>
									<span>请按照当前尺寸及大小修改</span>
									<span><img src="{$catename.pic}" id="is_lodding" height="80" alt=""></span>
								</dd>
							</li>
								<!-- <input class="seinp" type="text" name="title" value="{$catename.title}"> -->
							<li>
								<dd class="setting_t fl">关键词 ：</dd>
								<dd class="setting_p fl"><input class="seinp" type="text" name="keyword" value="{$catename.keyword}">
									<span>请用逗号隔开（如：关键词，关键词，关键词）</span>
								</dd>
							</li>


							<li>
								<dd class="setting_t fl">文章摘要 ：</dd>
								<dd class="setting_p fl"><textarea name="description" class="textarea bor" >{$catename.description}</textarea></dd>
							</li>


							<li>
								<dd class="setting_t fl"><span>*</span> 文章类别 ：</dd>
								<dd class="setting_p fl">
									<select  name="uid" id="uid" >
									<volist name="catelist" id="li">
										<option value="{$li.id}" <if condition="$li['id'] eq $catename['uid'] ">selected = "selected"</if>>{$li.html}{$li.name}</option>
									</volist>
									</select>	

								</dd>
							</li>

							<li>
								<dd class="setting_t fl">文章内容 ：</dd>
								<dd class="setting_p intop fl">
								<textarea name="content" class="textarea textared" id ='container'> {$catename.content}</textarea>
								</dd>
							</li>


							<li>
								<dd class="setting_t fl"> &nbsp;</dd>
								<dd class="setting_p fl">
								<input  type="hidden" name="pic1" value="{$catename.pic}">
								<input  type="hidden" name="id" value="{$_GET['id']}">
								<input  type="hidden" name="store_id" value="{$_GET['uid']}">
								<input class="submit" type="submit" value="保存">
									
								</dd>
							</li>
						</ul>
						

					</div>
					</form>
			</div>
	</div>
 </script>
  <script type="text/javascript">
  var ue = UE.getEditor('container', {
    initialFrameWidth:800,
    initialFrameHeight:300
  
  });
    </script>
		
  <script>

  	if($('#is_lodding').attr('src')==''){
  		$('#is_lodding').hide();
  	}
  //异步上传图片
    //上传图片 
   var oBtn = document.getElementById("J_dy_img"); 
    new AjaxUpload(oBtn,{
        action : "{:U('Index/AjaxUpload_Layout')}",
        data:{name:'pic',pach:'news'},
        onSubmit:function(file,ext){
            if(ext && /^(jpg|jpeg|png)$/.test(ext)){
                //ext是后缀名
                $("#is_lodding").show();
                oBtn.disabled = "disabled";
            }else{  ;
                return false;
            }
        }, 
        onComplete:function(file,response){ 
            var res = JSON.parse(response);
            if(res.status == 1){ 

          	  $('#is_lodding').val('');//格式化路径
              $('#is_lodding').attr('src','');//格式化路径

              $('#is_lodding').attr('src',res.path);
              $('#is_pach').val(res.path);
              oBtn.disabled = false;
             }else{

                alert('上传图片过大，请重新上传');
                oBtn.disabled = false;
          }
        }
    });
</script> 

</body>
</html>